Page({
  refuseAuth: function () {
    wx.switchTab({
      url: '../home/home'
    })
  },
  bindGetUserInfo: function (e) {
    var userInfo = e.detail.userInfo
    if (e.detail.userInfo) {
      wx.cloud.callFunction({
        name: 'getUser',
        data: {
        },
        success: res => {
          userInfo.openid = res.result.openid
          wx.setStorageSync('userInfo', userInfo);
          wx.showToast({
            title: '授权成功...',
            icon: 'none',
            duration: 1500
          })
          wx.navigateBack({
            delta: 1
          })
        }
      })

     
    }
  },
})
